`timescale 1ns/100ps

typedef struct {
    byte a;
    reg  b;
    shortint unsigned c;
} MyStruct;

module struct_literal ();

MyStruct ms = '{10, 0, 100};

MyStruct msa [0:1] = '{'{10, 0, 100}, '{11, 1, 101}};

initial begin
    $display ("Printing MyStruct");
    $display ("a = %b b = %b c = %h", ms.a, ms.b, ms.c);
    ms.a = 15;
    $display ("a = %b b = %b c = %h", ms.a, ms.b, ms.c);
    ms.c = 16'hDEAD; 
    $display ("a = %b b = %b c = %h", ms.a, ms.b, ms.c);
    $display ("Printing array of MyStruct");
    $display ("a = %b b = %b c = %h", 
        msa[0].a, msa[0].b, msa[0].c);
    $display ("a = %b b = %b c = %h", 
        msa[1].a, msa[1].b, msa[1].c);
    #1 $finish;
end

endmodule
